import React from "react";
const ContextDemo = React.lazy(() => import('./ContextDemo'))

// 异步组件 懒加载
class App extends React.Component {
  constructor(props) {
    super(props)
  }

  render() {
    return (
      <div>
        <p>引入一个动态组件</p>
        <hr />
        <React.Suspense fallback={<div>Loading...</div>}>
          <ContextDemo></ContextDemo>
        </React.Suspense>
      </div>
    )
  }
}

export default App